<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>DUXCMS 2.X 安装向导</title>
<link href="__PUBLIC__/css/base.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/css/install.css" rel="stylesheet" type="text/css">
</head>

<body>
<div class="install_main">
  <div class="install_menu">
    <ul>
      <li>阅读协议</li>
      <li class="selected">环境测试</li>
      <li>数据库信息</li>
      <li>安装完毕</li>
    </ul>
  </div>
  <div class="install_content">
    <div class="title">欢迎使用DUXCMS安装向导</div>
    <div class="central">
      <h1>服务器信息</h1>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
        <tr>
          <th width="150" align="left"><strong>参数</strong></th>
          <th align="left"><strong>值</strong></th>
        </tr>
        <tr>
          <td>服务器域名/IP地址</td>
          <td><?php echo $name."/".$host; ?></td>
        </tr>
        <tr>
          <td>服务器操作系统</td>
          <td><?php echo $os; ?></td>
        </tr>
        <tr>
          <td>服务器解译引擎</td>
          <td><?php echo $server; ?></td>
        </tr>
        <tr>
          <td>PHP版本</td>
          <td><?php echo $phpv; ?></td>
        </tr>
        <tr>
          <td>安装路径</td>
          <td><?php echo ROOT_PATH; ?></td>
        </tr>
        <tr>
          <td>脚本超时时间</td>
          <td><?php echo $max_execution_time; ?> 秒</td>
        </tr>
      </table>
      <h1>系统环境要求</h1>
      <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="table">
        <tr>
          <th width="230"><strong>变量函数</strong></th>
          <th width="100"><strong>系统要求</strong></th>
          <th><strong>实际状态及建议</strong></th>
        </tr>
        <tr>
          <td>GD 支持 </td>
          <td>支持</td>
          <td><?php echo $gd; ?></td>
        </tr>
        <tr>
          <td>MySQL 支持</td>
          <td>支持</td>
          <td><?php echo $mysql; ?></td>
        </tr>
        <tr>
          <td>upload</td>
          <td>支持</td>
          <td><?php echo $uploadSize ?></td>
        </tr>
        <tr>
          <td>session</td>
          <td>支持</td>
          <td><?php echo $session ?></td>
        </tr>
      </table>
      <h1>目录权限检测</h1>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
        <tr>
          <th width="230"><strong>目录名</strong></th>
          <th width="100"><strong>系统要求</strong></th>
          <th><strong>实际状态及建议</strong></th>
        </tr>
        <?php
		foreach($dir_list as $dir)
		{
        	$test_dir=ROOT_PATH.$dir;
			if(is_writable($test_dir)){
				$w = '<font color=green>[√]写</font>';
			}else{
				$w = '<font color=red>[×]写</font>';
				$err++;
			}
			if(is_readable($test_dir)){
				$r = '<font color=green>[√]读</font>' ;
			}else{
				$r = '<font color=red>[×]读</font>';
				$err++;
			}
		?>
        <tr>
          <td><?php echo $dir; ?></td>
          <td>读写</td>
          <td><?php echo $r." ".$w; ?></td>
        </tr>
        <?php } ?>
      </table>
    </div>
    <div class="bottuns">
    	<?php if($err>0){ ?>
        环境不符合无法继续安装，请调试后<a href="javascript:;" onClick="window.location.reload()">刷新</a>
<?php }else{ ?>
      <button type="button"  onclick="window.location.href='{$url(index/data)}'" > </button>
        <?php } ?>
      
    </div>
  </div>
</div>
</body>
</html>
